package org.fh.service.fhoa.impl;

import java.util.List;

import org.fh.dto.ClockinmyDTO;
import org.fh.entity.Page;
import org.fh.entity.PageData;
import org.fh.mapper.dsno1.fhoa.ClockinmyMapper;
import org.fh.service.fhoa.ClockinmyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional //开启事物
public class ClockinmyServiceImpl implements ClockinmyService{
	
	
	@Autowired
	private ClockinmyMapper clockinmyMapper;

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		clockinmyMapper.save(pd);
	}
	
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		clockinmyMapper.delete(pd);
	}
	
	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		clockinmyMapper.edit(pd);
	}
	
	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception{
		return clockinmyMapper.datalistPage(page);
	}
	
	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception{
		return clockinmyMapper.listAll(pd);
	}
	
	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return clockinmyMapper.findById(pd);
	}
	
	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		clockinmyMapper.deleteAll(ArrayDATA_IDS);
	}

	/**
	 * 根据用户名、客户名称筛选昨天和今天的打卡图片地址
	 * @param UNAME 用户名
	 * @param CUSTOMER_NAME 客户名称
	 * @return 图片地址列表
	 */
	public List<ClockinmyDTO> getPhotoAddaByUnameAndCustomerName(String UNAME, String CUSTOMER_NAME) {
		return clockinmyMapper.getPhotoAddaByUnameAndCustomerName(UNAME, CUSTOMER_NAME);
	}

//	/**
//	 * 根据用户名查询打卡信息
//	 * @param USERNAME
//	 * @return
//	 */
//	@Override
//	public List<ClockinmyDetailDTO> getClockDetail(String USERNAME) {
//
//		return clockinmyMapper.getClockDetail(USERNAME);
//	}

}
